'user strict'
import React, {Component} from 'react'

import '../../Scss/loadstatus'

export default class ConfirmBox extends Component {
    constructor(props) {
        super(props);
        this.state = {
            dataLoad: 0,
            dataNull: 0,
            dataEnd: 0
        };
    }
    componentWillReceiveProps() {
        setTimeout(() => {
            this.setState({dataLoad: this.props.dataLoad, dataNull: this.props.dataNull, dataEnd: this.props.dataEnd});
        }, 0)
    }
    render() {
        let {dataLoad, dataNull, dataEnd} = this.props;
        let {show} = this.state;
        return (
            <div className='loadstatus'>
                {dataLoad == 1
                    ? <span className='ing'>数据加载中...</span>
                    : ''}
                {dataNull == 1
                    ? <span className='no'>暂无信息</span>
                    : ''}
                {dataEnd == 1
                    ? <span className='end'>已加载全部信息</span>
                    : ''}
            </div>
        )
    }
}
